﻿<%@ Page Title="" Language="C#" MasterPageFile="~/RepairTracker.Master" AutoEventWireup="true" CodeBehind="workflow.aspx.cs" Inherits="RepairTracker.workflow" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style1 {
            height: 20px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:RadioButtonList ID="radioWorkflow" runat="server" 
        RepeatDirection="Horizontal" AutoPostBack="True" 
        onselectedindexchanged="radioWorkflow_SelectedIndexChanged" 
        Font-Size="Large">
        <asp:ListItem Value="3">入库</asp:ListItem>
        <asp:ListItem Value="2">出库</asp:ListItem>
        <asp:ListItem Value="1">维修登记</asp:ListItem>
    </asp:RadioButtonList>
            <asp:ObjectDataSource ID="sourceProduct" runat="server" 
                SelectMethod="GetProductsByOwnerId" 
        TypeName="RepairTracker.Entity">
                <SelectParameters>
                <asp:ControlParameter ControlID="lstOwner" Name="ownerId" 
                        PropertyName="SelectedValue" />
                <asp:ControlParameter ControlID="radioWorkflow" Name="statusId" 
                        PropertyName="SelectedValue" />
                <asp:ControlParameter ControlID="lstDevice" Name="deviceId" 
                        PropertyName="SelectedValue" />
                </SelectParameters>
                </asp:ObjectDataSource>
            <asp:ObjectDataSource ID="sourceProductSearch" runat="server" 
        SelectMethod="GetProductBySerialNO" TypeName="RepairTracker.Entity">
                <SelectParameters>
                    <asp:ControlParameter ControlID="radioWorkflow" Name="statusId" 
                        PropertyName="SelectedValue" Type="Int32" />
                    <asp:ControlParameter ControlID="txtSearchSerialNo" Name="serialNO" 
                        PropertyName="Text" Type="String" />
                </SelectParameters>
    </asp:ObjectDataSource>
    <hr/>
            <table width="100%" bgcolor="#CCFFCC">
                <tr>
                    <td colspan="2" bgcolor="#99FF99" style="font-weight: bolder">按序列号搜索</td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <asp:TextBox ID="txtSearchSerialNo" runat="server"></asp:TextBox>
                        <asp:Button ID="btnSearchBySerialNo" runat="server" Text="搜索" 
                            onclick="btnSearchBySerialNo_Click" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2"></td>
                </tr>
                <tr>
                <td colspan="2" bgcolor="#99FF99" style="font-weight: bolder">按网点搜索</td>
                </tr>
                <tr>
                <td></td>
                <td>
                    <asp:DropDownList ID="lstDistrict" runat="server" AutoPostBack="True" 
                        onselectedindexchanged="lstDistrict_SelectedIndexChanged" Width="100px">
                    </asp:DropDownList>
                    <asp:DropDownList ID="lstOwner" runat="server" AutoPostBack="True" 
                        onselectedindexchanged="lstOwner_SelectedIndexChanged" Width="150px">
                    </asp:DropDownList>
                    <asp:DropDownList ID="lstDevice" runat="server" AutoPostBack="True" 
                        onselectedindexchanged="lstDevice_SelectedIndexChanged" Width="100px">
                    </asp:DropDownList>  
                </td>
                </tr>
                <tr>
                    <td></td>
                    <td></td>
                </tr>
            </table>
    <asp:MultiView ID="mviewWorkflow" runat="server">
        <asp:View ID="viewDummy" runat="server">
            dummy
        </asp:View>
        <asp:View ID="viewRepair" runat="server">
            <asp:Panel ID="panelRepair" runat="server" >
            <table width="100%" bgcolor="#CCFFFF">
            <tr>
            <td colspan="2" class="style1" bgcolor="#66CCFF" style="font-weight: bolder">维修登记</td>
            </tr>
            <tr>
            <td></td>
            <td>故障类型：<asp:DropDownList ID="lstRepairFault" runat="server" Width="100px" 
                    AutoPostBack="True" 
                    onselectedindexchanged="lstRepairFault_SelectedIndexChanged">
                </asp:DropDownList>
            </td>
            </tr>
            <tr>
            <td></td>
            <td>维修内容：<asp:TextBox ID="txtRepairMethod" runat="server" Width="250px"></asp:TextBox>
                </td>
            </tr>
            <tr>
            <td></td>
            <td>更换备件：<asp:TextBox ID="txtRepairGear" runat="server" Width="250px"></asp:TextBox>
                </td>
            </tr>
            <tr>
            <td></td>
            <td>
                <asp:Button ID="btnRepair" runat="server" Text="维修完成" 
                    onclick="btnRepair_Click" />
                <asp:Label ID="lblRepairError" runat="server" ForeColor="Red"></asp:Label>
                </td>
            </tr>
            </table>
            </asp:Panel>
            
        </asp:View>
        <asp:View ID="viewOutput" runat="server">
            <asp:Panel ID="panelOutput" runat="server">
            <table width="100%" bgcolor="#CCFFFF">
            <tr>
            <td colspan="2" class="style1" bgcolor="#66CCFF" style="font-weight: bolder">此设备将被出库</td>
            </tr>
            <tr>
            <td></td>
            <td>序列号：<asp:Label ID="lblOutputSerialNo" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
            <td></td>
            <td>Psam卡号：<asp:Label ID="lblOutputPsamNo" runat="server"></asp:Label>
                固件版本：<asp:Label ID="lblOutputVersion" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
            <td></td>
            <td>
                <asp:Button ID="btnOutput" runat="server" Text="出库" onclick="btnOutput_Click" />
                <asp:Label ID="lblOutputError" runat="server" ForeColor="Red"></asp:Label>
                </td>
            </tr>
            </table>
            </asp:Panel>
            
        </asp:View>
        <asp:View ID="viewInput" runat="server">
            <asp:Panel ID="panelInsertAndInput" runat="server" Enabled="False">
                <table width="100%" bgcolor="#CCFFFF">
                    <tr>
                        <td colspan="2" class="style1" bgcolor="#66CCFF" style="font-weight: bolder">新增入库</td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>序列号：<asp:TextBox ID="txtInsertSerialNo" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                        PSAM卡号：<asp:TextBox ID="txtInsertPsamNo" runat="server"></asp:TextBox>
                        固件版本：<asp:TextBox ID="txtInsertVersion" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            网点信息：<asp:DropDownList ID="lstInsertDistrict" runat="server" 
                                onselectedindexchanged="lstInsertDistrict_SelectedIndexChanged" 
                                Width="100px" AutoPostBack="True">
                            </asp:DropDownList>
                            <asp:DropDownList ID="lstInsertOwner" runat="server" Width="150px">
                            </asp:DropDownList>
                            
                        </td>
                    </tr>
                    <tr>
                    <td></td>
                    <td>设备类型：<asp:DropDownList ID="lstInsertDevice" runat="server" Width="100px" 
                            onselectedindexchanged="lstInsertDevice_SelectedIndexChanged" 
                            AutoPostBack="True">
                    </asp:DropDownList></td>
                    </tr>
                    <tr>
                    <td></td>
                    <td>报修故障：<asp:DropDownList ID="lstInsertFault" runat="server" Width="100px">
                        </asp:DropDownList>
                    </td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            <asp:Button ID="btnInsertAndInput" runat="server" Text="新增并入库" 
                                onclick="btnInsertAndInput_Click" />
                            <asp:Label ID="lblInsertError" runat="server" ForeColor="Red"></asp:Label>
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <asp:Panel ID="panelInput" runat="server" Enabled="False">
            <table width="100%" bgcolor="#CCFFFF">
                    <tr>
                        <td colspan="2" class="style1" bgcolor="#66CCFF">此设备将被入库</td>
                    </tr>
                    <tr>
                        <td class="style1"></td>
                        <td class="style1">序列号：<asp:Label ID="lblInputSerialNo" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            PSAM卡号：<asp:Label ID="lblInputPsamNo" runat="server"></asp:Label>
                            固件版本：<asp:Label ID="lblInputVersion" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>报修故障：<asp:DropDownList ID="lstInputFault" runat="server" Width="100px" 
                                onselectedindexchanged="lstInputFault_SelectedIndexChanged">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            <asp:Button ID="btnInput" runat="server" Text="入库" onclick="btnInput_Click" />
                            <asp:Label ID="lblInputError" runat="server" ForeColor="Red"></asp:Label>
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            
        </asp:View>
    </asp:MultiView>
    <asp:GridView ID="dataProduct" runat="server" AutoGenerateColumns="False" 
                DataSourceID="sourceProduct" AutoGenerateSelectButton="True" 
                onselectedindexchanged="dataProduct_SelectedIndexChanged" CellPadding="4" 
                DataKeyNames="Id,DeviceId,DeviceName,DistrictId,DistrictName,OwnerId,OwnerName,SerialNo,PsamNo,Version" 
                ForeColor="#333333" GridLines="None" Width="100%">
                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                <Columns>
                    <asp:BoundField DataField="Id" HeaderText="Id" SortExpression="Id" 
                        Visible="False" />
                    <asp:BoundField DataField="DeviceId" HeaderText="DeviceId" 
                        SortExpression="DeviceId" Visible="False" />
                    <asp:BoundField DataField="DeviceName" HeaderText="设备类型" 
                        SortExpression="DeviceName" />
                    <asp:BoundField DataField="DistrictId" HeaderText="DistrictId" 
                        SortExpression="DistrictId" Visible="False" />
                    <asp:BoundField DataField="DistrictName" HeaderText="区县" 
                        SortExpression="DistrictName" />
                    <asp:BoundField DataField="OwnerId" HeaderText="OwnerId" 
                        SortExpression="OwnerId" Visible="False" />
                    <asp:BoundField DataField="OwnerName" HeaderText="网点" 
                        SortExpression="OwnerName" />
                    <asp:BoundField DataField="SerialNo" HeaderText="序列号" 
                        SortExpression="SerialNo" />
                    <asp:BoundField DataField="PsamNo" HeaderText="Psam卡号" 
                        SortExpression="PsamNo" />
                    <asp:BoundField DataField="Version" HeaderText="固件版本" 
                        SortExpression="Version" />
                    <asp:BoundField DataField="Counts" HeaderText="入库次数" 
                        SortExpression="Counts" />
                </Columns>
                <EditRowStyle BackColor="#999999" />
                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#E9E7E2" />
                <SortedAscendingHeaderStyle BackColor="#506C8C" />
                <SortedDescendingCellStyle BackColor="#FFFDF8" />
                <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
            </asp:GridView>
</asp:Content>

